package com.func.infrastructure.persistent.dao.activity;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import com.func.infrastructure.persistent.po.activity.RaffleActivityAccountDay;
import org.apache.ibatis.annotations.Mapper;

/**
 * <p>
 * IRaffleActivityAccountDayDao
 * </p>
 *
 * @author Simon
 * @version 2025.03.14.1.0.0
 * @description
 * @since 2025-03-14
 */

@Mapper
public interface IRaffleActivityAccountDayDao {
    /**
     * 查询账户日额度账户
     * @param activityAccountDayReq activityId, userId, day
     * @return 账户日额度账户
     */
    @DBRouter
    RaffleActivityAccountDay queryActivityAccountDayByUserId(RaffleActivityAccountDay activityAccountDayReq);

    /**
     * 日余额账户次数--
     * @param raffleActivityAccountDay activityId, userId, day
     * @return 影响的行数
     */
    int updateActivityAccountDaySubtractionQuota(RaffleActivityAccountDay raffleActivityAccountDay);

    /**
     * 新建日余额账户
     * @param raffleActivityAccountDay 日余额账户POJO类
     */
    void insertActivityAccountDay(RaffleActivityAccountDay raffleActivityAccountDay);

    @DBRouter
    Integer queryActivityAccountDayPartakeCount(RaffleActivityAccountDay raffleActivityAccountDayReq);

    void addAccountQuota(RaffleActivityAccountDay raffleActivityAccountDay);
}
